import request from "@/utils/request"

export default {
    // 添加文章
    addArtical(formData){
        const req = request({
            method: 'post',
            url: '/artical/add',
            data: formData,
            headers: {
                'Content-Type': "multipart/form-data"
            }
        })
        //返回ture or false
        return req
    },
    // 获取所有文章
    getListAll(formData){
        const req = request({
            method: 'post',
            url: '/artical/getListAll',
            data: formData,
            headers: {
                'Content-Type': "multipart/form-data"
            }
        })
        //返回ture or false
        return req
    },
    // 按分类获取文章
    getListByType(formData){
        const req = request({
            method: 'post',
            url: '/artical/getListByType',
            data: formData,
            headers: {
                'Content-Type': "multipart/form-data"
            }
        })
        //返回ture or false
        return req
    },
    // 编辑文章
    editArtical(formData){
        const req = request({
            method: 'post',
            url: '/artical/edit',
            data: formData,
            headers: {
                'Content-Type': "multipart/form-data"
            }
        })
        //返回ture or false
        return req
    },
    // 删除
    deleteArtical(formData){
        const req = request({
            method: 'post',
            url: '/artical/delete',
            data: formData,
            headers: {
                'Content-Type': "multipart/form-data"
            }
        })
        //返回ture or false
        return req
    },
}